import Vue from 'vue'
import Router from 'vue-router'
import index from '@/view/index'
import user from '@/view/user'
import login from '@/view/login'
import web from '@/view/web'
import api from '@/view/api'
import {recharge, upgrade} from '@/components/payCallback'
Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/user',
      name: 'user',
      component: user
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/web',
      name: 'web',
      component: web
    },
    {
      path: '/api',
      name: 'api',
      component: api
    },
    {
      path: '/upgrade ',
      name: 'upgrade',
      component: upgrade
    },
    {
      path: '/paymoney',
      name: 'paymoney',
      component: recharge
    }
  ]
})
const routerPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return routerPush.call(this, location).catch(error => error)
}
